extends Area2D

@export var bullet_speed:float = 100
@export var bullet_direction:float = 1
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	await  get_tree().create_timer(3).timeout
	queue_free()
 

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _physics_process(delta: float) -> void:
	position.x+=bullet_speed*delta*bullet_direction


func _on_area_entered(area: Area2D) -> void:
	#子弹命中敌人后销毁
	if area.is_in_group('Enemy') and not area.dead:
		queue_free()
